<script>
	const TUICalling = uni.requireNativePlugin('TUICallingUniPlugin-TUICallingModule');
	const TUICallingEvent = uni.requireNativePlugin('globalEvent');
	export default {
		onLaunch: function() {
			console.log('================App Launch=================');
			let platfrom= this.$u.os();
			let clientId="";
			if("android"===platfrom){
				clientId= plus.device.uuid;
			}
			//ios
			else{
				clientId=plus.device.uuid;
			}
			//console.log("clientId",clientId);
			this.$u.vuex('vuex_deviceMode',clientId);
			uni.$TUICalling = TUICalling;
			uni.$TUICallingEvent = TUICallingEvent;
			TUICallingEvent.addEventListener('onCallStart', function(e) {
			  console.log('TUIOfflinePushEvent',JSON.stringify(e));
			});
			plus.globalEvent.addEventListener('onCallStart', function(e) {
			  console.log('globalEvent',JSON.stringify(e));
			});
		},
		onShow: function() {
			
		},
		onHide: function() {
			console.log('App Hide')
		},
		onUnload:function(){
			TUICalling.logout((res) => {
			    console.log("音视频通话退出登录",JSON.stringify(res))
			})
		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";
	.test-border{
		border: 1px solid red;
	}
</style>

